home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group00a.txt / 000040_icon-group-sender _Wed Mar 1 10:33:17 2000.msg < prev    next >
Internet Message Format  |  2001-01-03  |  2KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id KAA06889
  4.     for icon-group-addresses; Wed, 1 Mar 2000 10:31:31 -0700 (MST)
  5. Message-Id: <200003011731.KAA06889@baskerville.CS.Arizona.EDU>
  6. From: gep2@terabites.com
  7. Date: Tue, 29 Feb 2000 18:31:14 -0600
  8. Subject: Re: closing a closed file
  9. To: icon-group@optima.CS.Arizona.EDU
  10. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  11. Status: RO
  12.  
  13. >> The Icon book doesn't say what happens when you close a closed file, but
  14. > some real applications assume that it is a no-op.  
  15.  
  16. That makes sense.  You close a file because you want it closed.  If it's ALREADY 
  17. in that condition, you got what you wanted.  No biggie.
  18.  
  19. > BTW IMHO file should not be closed more than one time ;-)
  20.  
  21. IMHO the system shouldn't care.
  22.  
  23. File handles, I believe, ought to behave like other Icon items.  When you don't 
  24. need them anymore, you simply overwrite the file handle and the file gets 
  25. "garbage collected".  (In that case, the ENTIRE close() routine becomes a 
  26. no-op).
  27.  
  28. Any files whose handles aren't closed before program exit ought to be closed 
  29. when the program exits.  
  30.  
  31. I don't see a BIG problem with allowing an explicit close.  But if you reopen an 
  32. existing file (and reuse a previously used handle) or close a file that's 
  33. already closed, or even just forget about closing one, the system shouldn't 
  34. really care.
  35.  
  36. Gordon Peterson
  37. http://web2.airmail.net/gep2/
  38. Support the Anti-SPAM Amendment!  Join at http://www.cauce.org/
  39. 12/19/98: the day the Conservatives demonstrated their scorn for their
  40.    fraudulent sham of representative government.  Voters, remember it!
  41.  
  42.